#include <G4ParticleDefinition.hh>
#include <G4ParticleTypes.hh>
#include <G4Track.hh>

#include "Messenger.hh"
#include "StackingAction.hh"

StackingAction::StackingAction() {
	;
}

StackingAction::~StackingAction() {
	;
}

G4ClassificationOfNewTrack StackingAction::ClassifyNewTrack(const G4Track* aTrack) {
	if (aTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition()) {
		// particle is optical photon
		if (aTrack->GetParentID() > 0) {
			// particle is secondary
			messenger->AddToPhotonCount();
		}
	}
	return fUrgent;
}
